﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MasterDetails2.aspx.cs" Inherits="ShoppingApp.MasterDetails2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="width: 100%">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="Addr_Id" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="Addr_Id" HeaderText="Addr_Id" InsertVisible="False" 
                ReadOnly="True" SortExpression="Addr_Id" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="Street" HeaderText="Street" 
                SortExpression="Street" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ShoppingAppDbConnectionString %>" 
        SelectCommand="SELECT [Addr_Id], [City], [Street] FROM [Addresses] WHERE ([Addr_Id] = @Addr_Id)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Addr_Id" QueryStringField="addrid" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
        <asp:HyperLink ID="HyperLink1" runat="server" 
            NavigateUrl="~/MasterDetails.aspx">Return to Shops</asp:HyperLink>
    </div>
</asp:Content>
